package api

import (
	"gitee.com/DengAnbang/Wefore/src/bean"
	"gitee.com/DengAnbang/Wefore/src/dbops"
	"gitee.com/DengAnbang/Wefore/src/fun"
	"gitee.com/DengAnbang/goutils/httpUtils"
	"net/http"
)

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 合同创建
* @description 合同创建的接口
* @method socket type=901
* @url /pc/contract/create
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"添加成功!"}
* @number 1
 */
func ContractCreateHttp(_ http.ResponseWriter, r *http.Request) error {
	htlx := httpUtils.GetValueFormRequest(r, "htlx")
	xmmc := httpUtils.GetValueFormRequest(r, "xmmc")
	no := httpUtils.GetValueFormRequest(r, "no")
	wtdw := httpUtils.GetValueFormRequest(r, "wtdw")
	fzr := httpUtils.GetValueFormRequest(r, "fzr")
	jbgk := httpUtils.GetValueFormRequest(r, "jbgk")
	sf := httpUtils.GetValueFormRequest(r, "sf")
	dq := httpUtils.GetValueFormRequest(r, "dq")
	bz := httpUtils.GetValueFormRequest(r, "bz")
	zxdw := httpUtils.GetValueFormRequest(r, "zxdw")
	tze := httpUtils.GetValueFormRequest(r, "tze")
	zxqk := httpUtils.GetValueFormRequest(r, "zxqk")
	htje := httpUtils.GetValueFormRequest(r, "htje")
	xz := httpUtils.GetValueFormRequest(r, "xz")
	gznr := httpUtils.GetValueFormRequest(r, "gznr")
	wcqk := httpUtils.GetValueFormRequest(r, "wcqk")
	sbqk := httpUtils.GetValueFormRequest(r, "sbqk")
	xxf := httpUtils.GetValueFormRequest(r, "xxf")
	wcrq := httpUtils.GetValueFormRequest(r, "wcrq")
	qsrq := httpUtils.GetValueFormRequest(r, "qsrq")
	qdrq := httpUtils.GetValueFormRequest(r, "qdrq")
	djrq := httpUtils.GetValueFormRequest(r, "djrq")
	htfj := httpUtils.GetValueFormRequest(r, "htfj")
	parent_id := httpUtils.GetValueFormRequest(r, "parent_id")
	jsje := httpUtils.GetValueFormRequest(r, "jsje")
	err := dbops.ContractCreate(parent_id, htlx, xmmc, no, wtdw, fzr, jbgk, sf, dq, bz, zxdw, tze, zxqk, htje, xz, gznr, wcqk, sbqk, xxf, wcrq, qsrq, qdrq, htfj, djrq, jsje)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("添加成功!")
}

func ContractCreateSocket(parameters map[string]interface{}) error {
	htlx := fun.GetString(parameters, "htlx")
	xmmc := fun.GetString(parameters, "xmmc")
	no := fun.GetString(parameters, "no")
	wtdw := fun.GetString(parameters, "wtdw")
	fzr := fun.GetString(parameters, "fzr")
	jbgk := fun.GetString(parameters, "jbgk")
	sf := fun.GetString(parameters, "sf")
	dq := fun.GetString(parameters, "dq")
	bz := fun.GetString(parameters, "bz")
	zxdw := fun.GetString(parameters, "zxdw")
	tze := fun.GetString(parameters, "tze")
	zxqk := fun.GetString(parameters, "zxqk")
	htje := fun.GetString(parameters, "htje")
	xz := fun.GetString(parameters, "xz")
	gznr := fun.GetString(parameters, "gznr")
	wcqk := fun.GetString(parameters, "wcqk")
	sbqk := fun.GetString(parameters, "sbqk")
	xxf := fun.GetString(parameters, "xxf")
	wcrq := fun.GetString(parameters, "wcrq")
	qsrq := fun.GetString(parameters, "qsrq")
	qdrq := fun.GetString(parameters, "qdrq")
	djrq := fun.GetString(parameters, "djrq")
	htfj := fun.GetString(parameters, "htfj")
	parent_id := fun.GetString(parameters, "parent_id")
	jsje := fun.GetString(parameters, "jsje")
	err := dbops.ContractCreate(parent_id, htlx, xmmc, no, wtdw, fzr, jbgk, sf, dq, bz, zxdw, tze, zxqk, htje, xz, gznr, wcqk, sbqk, xxf, wcrq, qsrq, qdrq, htfj, djrq, jsje)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("添加成功!")
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 合同删除
* @description 合同删除的接口
* @method socket type=902
* @url /pc/contract/delete
* @param id 必选 string id
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"删除成功"}
* @number 2
 */
func ContractDeleteHttp(_ http.ResponseWriter, r *http.Request) error {
	id := httpUtils.GetValueFormRequest(r, "id")
	err := dbops.ContractDelete(id)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("删除成功")

}

func ContractDeleteSocket(parameters map[string]interface{}) error {
	id := fun.GetString(parameters, "id")
	err := dbops.ContractDelete(id)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("删除成功!")
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 通过id查询合同
* @description 通过编号查询合同的接口
* @method socket type=903
* @url /pc/contract/select/id
* @param id 必选 string 编号
* @return {"code":0,"type":0,"message":"","debug_message":"","data":ContractBean}
* @number 3
 */
func ContractSelectByNoHttp(_ http.ResponseWriter, r *http.Request) error {
	id := httpUtils.GetValueFormRequest(r, "id")
	contract, err := dbops.ContractSelectByNo(id)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(contract)

}

func ContractSelectByNoSocket(parameters map[string]interface{}) error {
	id := fun.GetString(parameters, "id")
	contract, err := dbops.ContractSelectByNo(id)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(contract)
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 模糊查询合同
* @description 通过模糊查询合同的接口
* @method socket type=917
* @url /pc/contract/select/vague
* @param vague 必选 string 查询的内容
* @return {"code":0,"type":0,"message":"","debug_message":"","data":ContractBean}
* @number 17
 */
func ContractSelectByVagueHttp(_ http.ResponseWriter, r *http.Request) error {
	vague := httpUtils.GetValueFormRequest(r, "vague")
	contract, err := dbops.ContractSelectByVague(vague)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(contract)

}

func ContractSelectByVagueSocket(parameters map[string]interface{}) error {
	vague := fun.GetString(parameters, "vague")
	contract, err := dbops.ContractSelectByVague(vague)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(contract)
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 通过时间查询合同
* @description 通过时间查询合同的接口
* @method socket type=904
* @url /pc/contract/select/time
* @param htlx 选填 string 合同类型
* @param startTime 必填 string 开始的时间,格式:2006-01-02
* @param endTime 必填 string 结束的时间,格式:2006-01-02
* @return {"code":0,"type":0,"message":"","debug_message":"","data":[]ContractBean}
* @number 4
 */
func ContractSelectByTimeHttp(_ http.ResponseWriter, r *http.Request) error {
	htlx := httpUtils.GetValueFormRequest(r, "htlx")
	startTime := httpUtils.GetValueFormRequest(r, "startTime")
	endTime := httpUtils.GetValueFormRequest(r, "endTime")
	contract, err := dbops.ContractSelectByTime(htlx, startTime, endTime)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(contract)

}
func ContractSelectByTimeSocket(parameters map[string]interface{}) error {
	htlx := fun.GetString(parameters, "htlx")
	startTime := fun.GetString(parameters, "startTime")
	endTime := fun.GetString(parameters, "endTime")
	contracts, err := dbops.ContractSelectByTime(htlx, startTime, endTime)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(contracts)
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 添加合同发票信息
* @description 添加发票信息的接口
* @method socket type=905
* @url /pc/contract/additional/add
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"添加成功"}
* @number 5
 */
func ContractAdditionalAddHttp(_ http.ResponseWriter, r *http.Request) error {
	contract_id := httpUtils.GetValueFormRequest(r, "contract_id")
	lx := httpUtils.GetValueFormRequest(r, "lx")
	jbr := httpUtils.GetValueFormRequest(r, "jbr")
	nr := httpUtils.GetValueFormRequest(r, "nr")
	htmc := httpUtils.GetValueFormRequest(r, "htmc")
	wxdw := httpUtils.GetValueFormRequest(r, "wxdw")
	fpje := httpUtils.GetValueFormRequest(r, "fpje")
	fsrq := httpUtils.GetValueFormRequest(r, "fsrq")
	htfj := httpUtils.GetValueFormRequest(r, "htfj")
	htfl := httpUtils.GetValueFormRequest(r, "htfl")
	htnr := httpUtils.GetValueFormRequest(r, "htnr")
	additionalbean, err := dbops.ContractAdditionalAdd(contract_id, lx, jbr, nr, htmc, wxdw, fpje, fsrq, htfj, htfl, htnr)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(additionalbean)
}
func ContractAdditionalAddSocket(parameters map[string]interface{}) error {
	contract_id := fun.GetString(parameters, "contract_id")
	lx := fun.GetString(parameters, "lx")
	jbr := fun.GetString(parameters, "jbr")
	nr := fun.GetString(parameters, "nr")
	htmc := fun.GetString(parameters, "htmc")
	wxdw := fun.GetString(parameters, "wxdw")
	fpje := fun.GetString(parameters, "fpje")
	fsrq := fun.GetString(parameters, "fsrq")
	htfj := fun.GetString(parameters, "htfj")
	htfl := fun.GetString(parameters, "htfl")
	htnr := fun.GetString(parameters, "htnr")
	additionalbean, err := dbops.ContractAdditionalAdd(contract_id, lx, jbr, nr, htmc, wxdw, fpje, fsrq, htfj, htfl, htnr)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(additionalbean)
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 查询合同发票信息
* @description 查询合同发票信息的接口
* @method socket type=906
* @url /pc/contract/additional/select
* @param contract_id 必填 string 合同的ID
* @return {"code":0,"type":0,"message":"","debug_message":"","data":[]}
* @number 6
 */
func ContractAdditionalSelectHttp(_ http.ResponseWriter, r *http.Request) error {
	contract_id := httpUtils.GetValueFormRequest(r, "contract_id")
	beans, err := dbops.ContractAdditionalSelect(contract_id)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(beans)

}
func ContractAdditionalSelectSocket(parameters map[string]interface{}) error {
	contract_id := fun.GetString(parameters, "contract_id")
	beans, err := dbops.ContractAdditionalSelect(contract_id)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(beans)
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 修改合同发票信息
* @description 修合同发票信息的接口
* @method socket type=907
* @url /pc/contract/additional/update
* @param id 必填 string 合同的ID
* @param isModifyAttachment 选填 string 传0或者不填表示修改所有信息,包括附件,传1 表示只修改信息,不修改附件, 传2 表示 只修改附件 不修改其他信息
* @return {"code":0,"type":0,"message":"","debug_message":"","data":[]}
* @number 7
 */
func ContractAdditionalUpdateHttp(_ http.ResponseWriter, r *http.Request) error {
	id := httpUtils.GetValueFormRequest(r, "id")
	lx := httpUtils.GetValueFormRequest(r, "lx")
	jbr := httpUtils.GetValueFormRequest(r, "jbr")
	nr := httpUtils.GetValueFormRequest(r, "nr")
	htmc := httpUtils.GetValueFormRequest(r, "htmc")
	wxdw := httpUtils.GetValueFormRequest(r, "wxdw")
	fsrq := httpUtils.GetValueFormRequest(r, "fsrq")
	htfj := httpUtils.GetValueFormRequest(r, "htfj")
	htfl := httpUtils.GetValueFormRequest(r, "htfl")
	htnr := httpUtils.GetValueFormRequest(r, "htnr")
	isModifyAttachment := httpUtils.GetValueFormRequest(r, "isModifyAttachment")
	fpje := httpUtils.GetValueFormRequest(r, "fpje")
	err := dbops.ContractAdditionalUpdate(fpje, id, lx, jbr, nr, htmc, wxdw, htfj, htfl, htnr, fsrq, isModifyAttachment)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("修改成功")
}
func ContractAdditionalUpdateSocket(parameters map[string]interface{}) error {
	id := fun.GetString(parameters, "id")
	lx := fun.GetString(parameters, "lx")
	jbr := fun.GetString(parameters, "jbr")
	nr := fun.GetString(parameters, "nr")
	htmc := fun.GetString(parameters, "htmc")
	wxdw := fun.GetString(parameters, "wxdw")
	fsrq := fun.GetString(parameters, "fsrq")
	htfj := fun.GetString(parameters, "htfj")
	htfl := fun.GetString(parameters, "htfl")
	htnr := fun.GetString(parameters, "htnr")
	isModifyAttachment := fun.GetString(parameters, "isModifyAttachment")
	fpje := fun.GetString(parameters, "fpje")
	err := dbops.ContractAdditionalUpdate(fpje, id, lx, jbr, nr, htmc, wxdw, htfj, htfl, htnr, fsrq, isModifyAttachment)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("修改成功")
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 删除合同发票信息
* @description 删除合同发票信息
* @method socket type=908
* @url /pc/contract/additional/delete
* @param id 必填 string 合同的ID
* @param isModifyAttachment 必填 string 传1 表示不修改附件,传 0表示修改附件
* @return {"code":0,"type":0,"message":"","debug_message":"","data":[]}
* @number 8
 */
func ContractAdditionalDeleteHttp(_ http.ResponseWriter, r *http.Request) error {
	id := httpUtils.GetValueFormRequest(r, "id")
	err := dbops.ContractAdditionalDelete(id)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("删除成功")

}
func ContractAdditionalDeleteSocket(parameters map[string]interface{}) error {
	id := fun.GetString(parameters, "id")
	err := dbops.ContractAdditionalDelete(id)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("删除成功")
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 合同修改
* @description 合同修改的接口
* @method socket type=909
* @url /pc/contract/update
* @param isModifyAttachment 选填 string 传0或者不填表示修改所有信息,包括附件,传1 表示只修改信息,不修改附件, 传2 表示 只修改附件 不修改其他信息
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"修改成功!"}
* @number 9
 */
func ContractUpdateHttp(_ http.ResponseWriter, r *http.Request) error {
	id := httpUtils.GetValueFormRequest(r, "id")
	htlx := httpUtils.GetValueFormRequest(r, "htlx")
	xmmc := httpUtils.GetValueFormRequest(r, "xmmc")
	no := httpUtils.GetValueFormRequest(r, "no")
	wtdw := httpUtils.GetValueFormRequest(r, "wtdw")
	fzr := httpUtils.GetValueFormRequest(r, "fzr")
	jbgk := httpUtils.GetValueFormRequest(r, "jbgk")
	sf := httpUtils.GetValueFormRequest(r, "sf")
	dq := httpUtils.GetValueFormRequest(r, "dq")
	bz := httpUtils.GetValueFormRequest(r, "bz")
	zxdw := httpUtils.GetValueFormRequest(r, "zxdw")
	tze := httpUtils.GetValueFormRequest(r, "tze")
	zxqk := httpUtils.GetValueFormRequest(r, "zxqk")
	htje := httpUtils.GetValueFormRequest(r, "htje")
	xz := httpUtils.GetValueFormRequest(r, "xz")
	gznr := httpUtils.GetValueFormRequest(r, "gznr")
	wcqk := httpUtils.GetValueFormRequest(r, "wcqk")
	sbqk := httpUtils.GetValueFormRequest(r, "sbqk")
	xxf := httpUtils.GetValueFormRequest(r, "xxf")
	wcrq := httpUtils.GetValueFormRequest(r, "wcrq")
	qsrq := httpUtils.GetValueFormRequest(r, "qsrq")
	qdrq := httpUtils.GetValueFormRequest(r, "qdrq")
	djrq := httpUtils.GetValueFormRequest(r, "djrq")
	htfj := httpUtils.GetValueFormRequest(r, "htfj")
	isModifyAttachment := httpUtils.GetValueFormRequest(r, "isModifyAttachment")
	jsje := httpUtils.GetValueFormRequest(r, "jsje")
	err := dbops.ContractUpdate(id, htlx, xmmc, no, wtdw, fzr, jbgk, sf, dq, bz, zxdw, tze, zxqk, htje, xz, gznr, wcqk, sbqk, xxf, wcrq, qsrq, qdrq, htfj, djrq, isModifyAttachment, jsje)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("修改成功!")
}

func ContractUpdateSocket(parameters map[string]interface{}) error {
	id := fun.GetString(parameters, "id")
	htlx := fun.GetString(parameters, "htlx")
	xmmc := fun.GetString(parameters, "xmmc")
	no := fun.GetString(parameters, "no")
	wtdw := fun.GetString(parameters, "wtdw")
	fzr := fun.GetString(parameters, "fzr")
	jbgk := fun.GetString(parameters, "jbgk")
	sf := fun.GetString(parameters, "sf")
	dq := fun.GetString(parameters, "dq")
	bz := fun.GetString(parameters, "bz")
	zxdw := fun.GetString(parameters, "zxdw")
	tze := fun.GetString(parameters, "tze")
	zxqk := fun.GetString(parameters, "zxqk")
	htje := fun.GetString(parameters, "htje")
	xz := fun.GetString(parameters, "xz")
	gznr := fun.GetString(parameters, "gznr")
	wcqk := fun.GetString(parameters, "wcqk")
	sbqk := fun.GetString(parameters, "sbqk")
	xxf := fun.GetString(parameters, "xxf")
	wcrq := fun.GetString(parameters, "wcrq")
	qsrq := fun.GetString(parameters, "qsrq")
	qdrq := fun.GetString(parameters, "qdrq")
	djrq := fun.GetString(parameters, "djrq")
	htfj := fun.GetString(parameters, "htfj")
	isModifyAttachment := fun.GetString(parameters, "isModifyAttachment")
	jsje := fun.GetString(parameters, "jsje")
	err := dbops.ContractUpdate(id, htlx, xmmc, no, wtdw, fzr, jbgk, sf, dq, bz, zxdw, tze, zxqk, htje, xz, gznr, wcqk, sbqk, xxf, wcrq, qsrq, qdrq, htfj, djrq, isModifyAttachment, jsje)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("修改成功!")
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 合同类型的添加
* @description 合同类型的添加
* @method socket type=910
* @url /pc/contract/type/create
* @param type_name 必填 string 合同的类型的名称
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"创建成功"}
* @number 10
 */
func ContractTypeCreateHttp(_ http.ResponseWriter, r *http.Request) error {
	type_name := httpUtils.GetValueFormRequest(r, "type_name")
	err := dbops.ContractTypeCreate(type_name)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("创建成功")

}
func ContractTypeCreateSocket(parameters map[string]interface{}) error {
	type_name := fun.GetString(parameters, "type_name")
	err := dbops.ContractTypeCreate(type_name)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("创建成功")
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 合同类型的查询
* @description 合同类型的查询
* @method socket type=911
* @url /pc/contract/type/select/all
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"创建成功"}
* @number 11
 */
func ContractTypeSelectAllHttp(_ http.ResponseWriter, r *http.Request) error {
	beans, err := dbops.ContractTypeSelectAll()
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(beans)

}
func ContractTypeSelectAllSocket(parameters map[string]interface{}) error {
	beans, err := dbops.ContractTypeSelectAll()
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(beans)
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 合同时间的查询
* @description 合同类型的查询
* @method socket type=912
* @url /pc/contract/year/select/all
* @param htlx 必填 string 合同的类型的名称
* @return {"code":0,"type":0,"message":"","debug_message":"","data":[1970,1971]}
* @number 12
 */
func ContractYearSelectAllHttp(_ http.ResponseWriter, r *http.Request) error {
	htlx := httpUtils.GetValueFormRequest(r, "htlx")
	beans, err := dbops.ContractYearSelectAll(htlx)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(beans)

}
func ContractYearSelectAllSocket(parameters map[string]interface{}) error {
	htlx := fun.GetString(parameters, "htlx")
	beans, err := dbops.ContractYearSelectAll(htlx)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(beans)
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 删除合同类型
* @description 删除合同类型
* @method socket type=913
* @url /pc/contract/type/delete
* @param type_name 必填 string 合同的类型的名称
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"删除成功"}
* @number 12
 */
func ContractTypeDeleteHttp(_ http.ResponseWriter, r *http.Request) error {
	type_name := httpUtils.GetValueFormRequest(r, "type_name")
	err := dbops.ContractTypeDelete(type_name)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("删除成功")

}
func ContractTypeDeleteSocket(parameters map[string]interface{}) error {
	type_name := fun.GetString(parameters, "type_name")
	err := dbops.ContractTypeDelete(type_name)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("删除成功")
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 工作类型的添加
* @description 工作类型的添加
* @method socket type=914
* @url /pc/work/type/create
* @param type_name 必填 string 工作的类型的名称
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"创建成功"}
* @number 10
 */
func WorkTypeCreateHttp(_ http.ResponseWriter, r *http.Request) error {
	type_name := httpUtils.GetValueFormRequest(r, "type_name")
	err := dbops.WorkTypeCreate(type_name)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("创建成功")

}
func WorkTypeCreateSocket(parameters map[string]interface{}) error {
	type_name := fun.GetString(parameters, "type_name")
	err := dbops.WorkTypeCreate(type_name)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("创建成功")
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 工作类型的查询
* @description 工作类型的查询
* @method socket type=915
* @url /pc/work/type/select/all
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"创建成功"}
* @number 11
 */
func WorkTypeSelectAllHttp(_ http.ResponseWriter, r *http.Request) error {
	beans, err := dbops.WorkTypeSelectAll()
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(beans)

}
func WorkTypeSelectAllSocket(parameters map[string]interface{}) error {
	beans, err := dbops.WorkTypeSelectAll()
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage(beans)
}

/**
* showdoc
* @catalog 接口文档/合同相关
* @title 删除工作类型
* @description 删除工作类型
* @method socket type=916
* @url /pc/work/type/delete
* @param type_name 必填 string 工作的类型的名称
* @return {"code":0,"type":0,"message":"","debug_message":"","data":"删除成功"}
* @number 12
 */
func WorkTypeDeleteHttp(_ http.ResponseWriter, r *http.Request) error {
	type_name := httpUtils.GetValueFormRequest(r, "type_name")
	err := dbops.WorkTypeDelete(type_name)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("删除成功")

}
func WorkTypeDeleteSocket(parameters map[string]interface{}) error {
	type_name := fun.GetString(parameters, "type_name")
	err := dbops.WorkTypeDelete(type_name)
	if err != nil {
		return err
	}
	return bean.NewSucceedMessage("删除成功")
}
